package ar.com.vates.hilos1;

public class Contador implements Runnable {

	private int cont = 1;

	@Override
	public void run() {

		try {
			long tiempoInicio = System.currentTimeMillis();
			while (cont <= 101) {
				System.out.println(cont);

				if (cont % 10 == 0) {

					System.out.println("numero: " + cont
							+ " Tiempo de ejecucion: "
							+ (System.currentTimeMillis() - tiempoInicio));
				}

				Thread.sleep(1000);
				cont++;
			}

		} catch (InterruptedException e) {
			System.out.println("Error I/O");

		}

	}

}
